//
//  UIButton+Extension.swift
//  Wei91BoiOS
//
//  Created by bing on 16/3/26.
//  Copyright © 2016年 bing. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(title: String, imageName: String, bkgImage: String = "timeline_card_bottom_background", textColor: UIColor = UIColor.lightGrayColor(), textFont: CGFloat = QBStatusCellBottomDefaultFontSize) {
        
        self.init()
        
        // 设置
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: bkgImage), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: "\(bkgImage)_highlighted"), forState: UIControlState.Highlighted)
        setTitleColor(textColor, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(textFont)
    }
}